# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor 03/08/04 <lefungus@altern.org>

pkgname=libmatroska
pkgver=1.6.3
pkgrel=1
pkgdesc='Matroska library'
arch=(x86_64)
url=https://github.com/Matroska-Org/libmatroska
license=(LGPL2.1)
depends=(libebml.so)
makedepends=(
  cmake
  git
  ninja
)
provides=(libmatroska.so)
_tag=a72667e36153c418cab3ca1b3dcfd85afb25942f
source=(git+https://github.com/Matroska-Org/libmatroska.git#tag=${_tag})
sha256sums=(SKIP)

pkgver() {
  cd libmatroska

  git describe --tags | sed 's/^release-//'
}

build() {
  cmake -S libmatroska -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DBUILD_SHARED_LIBS=ON
  cmake --build build
}

package() {
  DESTDIR="${pkgdir}" cmake --build build --target install
}

# vim: ts=2 sw=2 et:
